package com.cencat.order.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 订单查询DTO
 * @author cencat
 * @description 固定商家场景多租户SaaS企业综合管理系统订单查询DTO
 * @since 2024-01-01
 */
@Data
@Schema(description = "订单查询DTO")
public class OrderQueryDTO {

    @Schema(description = "租户ID")
    private Long tenantId;

    @Schema(description = "订单ID")
    private Long orderId;

    @Schema(description = "订单编号")
    private String orderNo;

    @Schema(description = "商家ID")
    private Long merchantId;

    @Schema(description = "用户ID")
    private Long userId;

    @Schema(description = "订单状态")
    private String orderStatus;

    @Schema(description = "订单状态列表")
    private List<String> orderStatusList;

    @Schema(description = "支付状态")
    private String paymentStatus;

    @Schema(description = "配送状态")
    private String deliveryStatus;

    @Schema(description = "收货人姓名")
    private String receiverName;

    @Schema(description = "收货人手机号")
    private String receiverPhone;

    @Schema(description = "最小订单金额")
    @Min(value = 0, message = "最小订单金额不能小于0")
    private BigDecimal minOrderAmount;

    @Schema(description = "最大订单金额")
    @Min(value = 0, message = "最大订单金额不能小于0")
    private BigDecimal maxOrderAmount;

    @Schema(description = "创建时间开始")
    private LocalDateTime createTimeStart;

    @Schema(description = "创建时间结束")
    private LocalDateTime createTimeEnd;

    @Schema(description = "支付时间开始")
    private LocalDateTime payTimeStart;

    @Schema(description = "支付时间结束")
    private LocalDateTime payTimeEnd;

    @Schema(description = "配送时间开始")
    private LocalDateTime deliveryTimeStart;

    @Schema(description = "配送时间结束")
    private LocalDateTime deliveryTimeEnd;

    @Schema(description = "完成时间开始")
    private LocalDateTime completeTimeStart;

    @Schema(description = "完成时间结束")
    private LocalDateTime completeTimeEnd;

    @Schema(description = "配送方式")
    private String deliveryMethod;

    @Schema(description = "支付方式")
    private String paymentMethod;

    @Schema(description = "商品名称关键字")
    private String productNameKeyword;

    @Schema(description = "订单备注关键字")
    private String orderRemarkKeyword;

    @Schema(description = "是否使用优惠券")
    private Boolean useCoupon;

    @Schema(description = "是否使用积分")
    private Boolean usePoints;

    @Schema(description = "物流状态")
    private String shippingStatus;

    @Schema(description = "最小金额")
    @Min(value = 0, message = "最小金额不能小于0")
    private BigDecimal minAmount;

    @Schema(description = "最大金额")
    @Min(value = 0, message = "最大金额不能小于0")
    private BigDecimal maxAmount;

    @Schema(description = "开始时间")
    private LocalDateTime startTime;

    @Schema(description = "结束时间")
    private LocalDateTime endTime;

    @Schema(description = "排序字段")
    private String sortField;

    @Schema(description = "排序方向 ASC/DESC")
    private String sortDirection;

    @Schema(description = "当前页码")
    @Min(value = 1, message = "当前页码不能小于1")
    private Integer current = 1;

    @Schema(description = "每页大小")
    @Min(value = 1, message = "每页大小不能小于1")
    private Integer size = 10;
}